﻿@model IEnumerable<LaMalleAJeux.Models.Game>
@using LaMalleAJeux.Helpers

@{
    ViewBag.Title = @Html.Localise("BackOffice");
}

<h2>@Html.Localise("BackOffice")</h2>

<p>
    @Html.ActionLink(@Html.Localise("NewGame"), "Create")
</p>
@using(Html.BeginForm("SearchIndex", "Games", FormMethod.Get))
{   
        <p> @Html.Localise("FindAGame") @Html.TextBox("SearchString") 
        <input type="submit" value="@Html.Localise("Filter")" /></p>
}
<table>
    <tr>
        <th>
            @Html.Localise("Name")
        </th>
        <th>
            @Html.Localise("Price")
        </th>
        <th>
            @Html.Localise("Rating")
        </th>
        <th>
            @Html.Localise("IsNew")
        </th>
        <th>
            @Html.Localise("IsVisible")
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Price)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Rating)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.IsNew)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.IsVisible)
        </td>
        <td>
            @Html.ActionLink(@Html.Localise("Edit"), "Edit", new { id = item.Id }) |
            @Html.ActionLink(@Html.Localise("Details"), "Details", new { id = item.Id }) |
            @Html.ActionLink(@Html.Localise("Delete"), "Delete", new { id = item.Id })
        </td>
    </tr>
}

</table>
